﻿<dialogs:DialogWindow x:Class="Mnk.TBox.Plugins.Encoder.Components.Dialog"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:loc="clr-namespace:Mnk.TBox.Plugins.Encoder.Code.Localization"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:dialogs="clr-namespace:Mnk.Library.WpfControls.Dialogs;assembly=Mnk.Library.WPFControls" mc:Ignorable="d" 
             xmlns:wpfSyntaxHighlighter="clr-namespace:Mnk.Library.WpfSyntaxHighlighter;assembly=Mnk.Library.WPFSyntaxHighlighter"
                      xmlns:components="clr-namespace:Mnk.Library.WpfControls.Components;assembly=Mnk.Library.WPFControls"
                      xmlns:components1="clr-namespace:Mnk.TBox.Plugins.Encoder.Components"
                      ShowInTaskbar="True" Title="Encoder"
             Width="640" Height="480"
             d:DesignHeight="300" d:DesignWidth="300"
             MinWidth="640" MinHeight="480"
             FocusManager.FocusedElement="{Binding ElementName=Source}"
                      >
    <DockPanel>
        <DockPanel Name="Operations" DockPanel.Dock="Right" >
            <Button Content="{loc:Tr SwapTexts}" Click="ButtonSwapClick" DockPanel.Dock="Top"/>
            <Button Content="{loc:Tr ToClipboard}" IsDefault="True" Click="BtnToClipboardClick" DockPanel.Dock="Top" />
            <Button Content="{loc:Tr Clear}" Click="BtnClearClick" DockPanel.Dock="Top" />
            <components:ExtCheckBox Name="ConvertOnSourceChanged" Content="{loc:Tr ConvertOnSourceChanged}" Margin="5" IsChecked="{Binding ConvertOnSourceChanged}" DockPanel.Dock="Top"/>
            <Button Content="{loc:Tr Cancel}" HorizontalAlignment="Right" IsCancel="True" Margin="5" Click="CancelClick" DockPanel.Dock="Bottom"/>
            <components:ExtListBox Name="Encoders" Margin="2" SelectedIndex="{Binding SelectedEncoder}" ItemsSource="{Binding KnownEncoders, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type components1:Dialog}}}" SelectionChanged="Selector_OnSelectionChanged"/>
        </DockPanel>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="160" MinHeight="64"/>
                <RowDefinition Height="5"/>
                <RowDefinition MinHeight="64"/>
            </Grid.RowDefinitions>
            <wpfSyntaxHighlighter:SyntaxHighlighter x:Name="Source" IsWordWrap="{Binding ElementName=Result, Path=IsWordWrap}" IsWhiteSpaces="{Binding ElementName=Result, Path=IsWhiteSpaces}" Format="{Binding ElementName=Result, Path=Format}" IsStatusBarVisible="False" TextChanged="Source_OnTextChanged" Text="{Binding SourceText}"/>
            <GridSplitter HorizontalAlignment="Stretch" Grid.Row="1"/>
            <wpfSyntaxHighlighter:SyntaxHighlighter x:Name="Result" Grid.Row="2" IsWordWrap="True"/>
        </Grid>
    </DockPanel>
</dialogs:DialogWindow>
